﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LeanEngine.Data.Linq.Mapping
{
    /// <summary>
    /// Associate a class that has multiple primary keys columns in a database table
    /// </summary>
    [AttributeUsage(AttributeTargets.Property,
                    AllowMultiple=false,
                    Inherited=false)]
    [CLSCompliant(false)]
    public sealed class ColumnsAttribute : Attribute
    {
        private string[] _names;

        /// <summary>
        /// Initialize a new instance of System.Data.Linq.Mapping.ColumnsAttribute class.
        /// </summary>
        public ColumnsAttribute(string[] names)
        {
            this._names = names;
        }

        /// <summary>
        /// Gets a list of columns names
        /// </summary>
        public string[] GetNames()
        {
            return (string[])this._names.Clone();
        }
    }
}
